/*
 * Copyright 2009 Biz-e (info@biz-e.nl)
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package nl.biz_e.appengine.lib.shared.login;

import java.io.Serializable;

/**
 * @author Joost A. Bloemsma
 * 
 */
public class GoogleLoginInfo implements Serializable, IUser {
	
	private static final long serialVersionUID = -6535776816210952849L;
	private boolean loggedIn = false;
	private String loginUrl;
	private String logoutUrl;
	private String emailAddress;
	private String nickname;
	private String authDomain;
	private boolean admin = false;
	private boolean loginError = false;
	private String googleId;
	
	/**
	 * @return the loggedIn
	 */
	public boolean isLoggedIn() {
		return loggedIn;
	}
	
	/**
	 * @param loggedIn
	 *        the loggedIn to set
	 */
	public void setLoggedIn(boolean loggedIn) {
		this.loggedIn = loggedIn;
	}
	
	/**
	 * @return the loginUrl
	 */
	public String getLoginUrl() {
		return loginUrl;
	}
	
	/**
	 * @param loginUrl
	 *        the loginUrl to set
	 */
	public void setLoginUrl(String loginUrl) {
		this.loginUrl = loginUrl;
	}
	
	/**
	 * @return the logoutUrl
	 */
	public String getLogoutUrl() {
		return logoutUrl;
	}
	
	/**
	 * @param logoutUrl
	 *        the logoutUrl to set
	 */
	public void setLogoutUrl(String logoutUrl) {
		this.logoutUrl = logoutUrl;
	}
	
	/**
	 * @return the emailAddress
	 */
	public String getEmailAddress() {
		return emailAddress;
	}
	
	/**
	 * @param emailAddress
	 *        the emailAddress to set
	 */
	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}
	
	/**
	 * @return the nickname
	 */
	public String getNickname() {
		return nickname;
	}
	
	/**
	 * @param nickname
	 *        the nickname to set
	 */
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	
	/**
	 * @return the authDomain
	 */
	public String getAuthDomain() {
		return authDomain;
	}
	
	/**
	 * @param authDomain
	 *        the authDomain to set
	 */
	public void setAuthDomain(String authDomain) {
		this.authDomain = authDomain;
	}
	
	/**
	 * @return the admin
	 */
	public boolean isAdmin() {
		return admin;
	}
	
	/**
	 * @param admin
	 *        the admin to set
	 */
	public void setAdmin(boolean admin) {
		this.admin = admin;
	}
	
	/**
	 * @param loginError
	 *        the loginError to set
	 */
	public void setLoginError(boolean loginError) {
		this.loginError = loginError;
	}
	
	/**
	 * @return the loginError
	 */
	public boolean isLoginError() {
		return loginError;
	}
	
	/**
	 * @return the googleId
	 */
	public String getGoogleId() {
		return googleId;
	}
	
	/**
	 * @param googleId
	 *        the googleId to set
	 */
	public void setGoogleId(String googleId) {
		this.googleId = googleId;
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public String getName() {
		return getEmailAddress();
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public String getAuthenticationId() {
		return getGoogleId();
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean isGoogleLogin() {
		return true;
	}
	
}
